<?php

declare(strict_types=1);

namespace App\Request\User;

use App\Request\BaseCommonRequest;
use Hyperf\Context\Context;
use Hyperf\Validation\Request\FormRequest;

class CanCancelAccountRequest extends BaseCommonRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'imei' => 'required'
        ];
    }

    /**
     * 获取已定义验证规则的错误消息
     */
    public function messages(): array
    {
        $language = Context::get('language');
        if ($language == 'zh-cn') {
            return [
                'imei.required' => 'imei不能为空'
            ];
        } elseif ($language == 'zh-hk') {
            return [
                'imei.required' => 'imei不能為空'
            ];
        } else {
            return [
                'imei.required' => 'imei field is required.',
            ];
        }

    }

}